using CQRS.Events;
using CQRS.Infrastructure;
using CQRS.Infrastructure.Hermes.Infrastructure.ServiceLocator;
using CQRS.Reports;
using CQRS.Sample.Domain.CommandHandlers;
using CQRS.Sample.Domain.Events;
using CQRS.Sample.Domain.ReportDtos;

namespace CQRS.Example.SampleApplication
{
    public static class ApplicationStarter
    {
        public static void Start()
        {
            IoC.RegisterAll();
            new MongoDbEventDatabaseCreator(new MongoDatabaseHelper()).Create();
            new MsSqlReportDatabaseCreator().Create(typeof (PlaneReport).Assembly);
            MessageHandlersInMessageRouterRegistrator.BootStrap(typeof(PlaneCreatedEvent).Assembly,
                typeof(Event), typeof(IEventHandler<>));
            MessageHandlersInMessageRouterRegistrator.BootStrap(typeof(CreatePlaneCommandHandler).Assembly,
                typeof(Command), typeof(ICommandHandler<>));
       
        }
    }
}